< previous page
page_209
next page >
Page 209
CDbl( )
CDbl()
converts any numeric or string expression into a double value. Heres an example:
Private Sub cmdCDbl_Click ()
Dim dblValue As Double
dblValue = CDbl("12.99334")
Me.Cls
Me.Print dblValue
End Sub
CInt( )
CInt()
converts any numeric or string expression into an integer value. Heres an example:
Private Sub cmdCInt_Click ()
Dim intCount As Integer
intCount = CInt(1555.9)
Me.Cls
Me.Print intCount
End Sub
Heres the output:
1556
NOTE
The
CInt()
function does round any decimal portion.
CLng( )
CLng()
converts any numeric or string expression into a long value. Heres an example:
Private Sub cmdCLng_Click ()
Dim lngRet As Long
< previous page
page_209
next page >
If you like this book, buy it!